﻿function createExampleTab(id, url, text){
    var win, tab, hostName, exampleName, node, nombre;
    
    
    if(id == "-"){
        id = Ext.id();
        nombre = url;
        url = "/Modulos"+url;
    }
    
   
    hostName = window.location.protocol+"//"+window.location.host;
    exampleName = url.substr(9);
    
    tab = NavegacionTabs.add(new Ext.Panel({
       id: id,
       tbar: [{

            text: 'Recargar',
            handler: function() {
                Ext.getCmp(id).reload(true)
            },
            iconCls: 'icon-arrow-refresh'
}],
        title: text,
        autoLoad: {
            showMask: true,
            scripts: true,
            mode: "iframe",
            url: hostName+url
        },
        listeners: {
            deactivate: {
                fn: function(el) {
                    if (this.sWin && this.sWin.isVisible()) {
                        this.sWin.hide();
                    }
                }
            }
        },
        closable: true
    }));
    
    tab.sWin = win;
    NavegacionTabs.setActiveTab(tab);
    
    node = arbolNavegacion.getNodeById(id);
    if(node){
        node.ensureVisible();
    }
}